$(function(){
	var htmlTxt="游客，欢迎您　<a href='/user/login.htm'>[登录]</a> <a href='/user/reg.htm'>[免费注册]</a><a href='/user/getPass.htm'>[忘记密码]</a><a href='/user/qq.htm'>[QQ登录]</a>";
	$.ajax(
	{
		url:"/user/getLoginUser.json",
		type:"get",
		data:"",
		dataType:"json",
		success:function(data){
			if(data.result==true)
			{
				var userName=data.t.userName;
				if(data.t.nickName!=null){
					userName=data.t.nickName;
				}
				htmlTxt="<a href='/user/'>"+userName+"</a>  ，欢迎您　<a href='/user/logout.htm'>[退出]</a> ";
			}
			$("#userpanel").html(htmlTxt);
		},
		error:function(XMLHttpRequest, textStatus, errorThrown){
			$("#userpanel").html(htmlTxt);
		}
	});
});